//
// Created by bjliuyong on 2021/6/7.
//

#ifndef GC_MEMORYCELL_H
#define GC_MEMORYCELL_H

#include "../common.h"

class MemoryCell {
private:
    uint m_start;
    uint m_end;
    uint m_size;
    bool m_mark;
    pvoid m_chunk;

public:
    ~MemoryCell();
    MemoryCell(uint start,uint size);
    MemoryCell(MemoryCell &cell);
    bool operator>(MemoryCell &cell);
    bool operator<(MemoryCell &cell);

public:
    void set_chunk(pvoid m_chunk);
    uint get_start();
    MemoryCell* set_start(uint start);
    MemoryCell* inc_start(uint step);
    uint get_size();
    void set_size(uint size);
    MemoryCell* desc_size(uint step);
    void inc_size(uint step);
    uint get_end();
    void set_end(uint end);
    void set_mark(bool mark);
    bool get_mark();
    pvoid ptr();
};
#endif //GC_MEMORYCELL_H
